Auto Commit

Description

Auto commit the Ink every time the user interacts (draws a stroke or erases). For larger ink areas, this should be left off. If off, the Ink Editor's .commit() method can be used to commit the Ink data.

Auto Commit is very useful if you want to store Ink data in a database. All of the data in the ink control is stored as text, albeit text that is only really meaningful to Alpha Anywhere. However, because the Ink data is text data, it is relatively inexpensive and easy to store in a database. By default the Ink control does not automatically commit the text values it generates to other controls. Checking the Auto Commit checkbox means will allow the data created in the editor to be committed. Watch the following video for more information. You can also follow the guide below.

Getting and Setting Ink Values using Auto Commit

  1. In the UX Builder open the UX Controls page's Data Controls menu. Click on [Ink] to add an ink control to the component.

    images/get.png
  2. Open the Other Controls menu. Click on the [Button] option to add a button to the component. Give it the label 'Get Value'.

    images/get2.png
  3. In the Other Controls menu click on the [Static Text] option to add a static text control to the component.

    images/get3.png
  4. Highlight the Static Text Control. In the Properties list on the right set the Static text property to be a div tag with an id of "div1".

    <div id="div1"></div>
    images/get4.png
  5. Highlight the Button control. In the properties list scroll down to the Javascript section. Click on the button next to the 'onClick' event.

    images/get5.png
  6. Select the 'Text mode' option and add the following code to the onClick event, then click Save.

    var val = {dialog.object}.getValue('ink1');
    var ele = $('div1');
    ele.innerHTML = val;
    images/get6.png
  7. Highlight the Ink control. In the Ink Properties section click the next to the Ink properties property.

    images/get7.png
  8. In the Ink Control dialog's Ink Control section check the 'Auto Commit' property and then Click OK.

    images/get8.png
  9. Run the Component in Working Preview. Scribble some lines in the Ink Control editor.

    images/get9.png
  10. Click the Get Value button that you defined. You should see the text version of the data populate the Static Text Control.

    images/get10.png
    Not all of the text data generated from this example is shown in the image above